package com.itheima.dao.impl;

import com.itheima.dao.UserDao;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Lazy(false)
@Scope("singleton")
//@Component(value = "userDao")
@Repository(value = "userDao")
public class UserDaoImpl implements UserDao {
    public UserDaoImpl() {
        System.out.println("userDao创建");
    }

    @PostConstruct
    public void init(){
        System.out.println("userDao的初始化方法");
    }

    @PreDestroy
    public void destroy(){
        System.out.println("userDao的销毁方法");
    }
}
